<?php

class MountsController extends \BaseController {

	/**
	 * Display a listing of the resource.
	 * GET /mounts
	 *
	 * @return Response
	 */
	public function index()
	{
		//

        $PATH = "http://7sbkhv.com1.z0.glb.clouddn.com/";
        $customer_id = Session::get('customer_id');
        $mounts = Mount::where('customer_id',$customer_id)
            ->where('state','>',0)
            ->orderBy('created_at', 'DESC')
            ->get();
        return View::make('mounts.index',compact('mounts','PATH'));
	}

	/**
	 * Show the form for creating a new resource.
	 * GET /mounts/create
	 *
	 * @return Response
	 */
	public function create()
	{
		//
	}

	/**
	 * 试用表单处理
	 * POST /mounts
	 *
	 * @return Response
	 */
	public function store()
	{
		//
        $customer_id = Session::get('customer_id');
        $customer = Customer::find($customer_id);
        $area_id = Area::find(Input::get('area_id'));
        $get_area = Input::get('area_id');
        if(!$get_area || $get_area == ''){//如果未选择自动提示，前端填写input提交
            $count_area = Area::where('name',Input::get('area_name'))->where('city_id',$customer->city)->count();//查询是否存在该小区
            if($count_area != 0){//已存在则获取小区id
                $area_id = Area::where('name',Input::get('area_name'))->where('city_id',$customer->city)->first();
                //获取分销商
                $area = Area::find($area_id->father_id);
            }else{
                //查询是否有默认分销商
//                $count = User::where('permissions', '{"section":1}')->where('default',1)->count();
//                if($count != 0){//有则将用户分该改分销商
//                    $user = User::where('permissions', '{"section":1}')->where('default',1)->first();
//
                    //create不存在小区，且无father_id，city_id

                    $area_id = new Area();
                    $area_id->name = Input::get('area_name');
                    $area_id->level = 4;
                    $area_id->save();
                    $noarea =1;
//                    //获取分销商
//                    $area = Area::find($user->area);
//                }else{
//                    echo '该小区不在服务范围';
//                    exit;
//                }

            }
        }else{
            $area = Area::find($area_id->father_id);
        }

        //获取备注
        $remark = Input::get('time');
        //新增提交试用装机记录
        if($noarea == 1){
            $mount_id = Mount::insert_try($customer_id,Input::get('name'),Input::get('mobile'),Input::get('address'),Input::get('sex'),$area_id->id,'',implode(',',$remark),$customer->city,Input::get('machine'));
        }else{
            $mount_id = Mount::insert_try($customer_id,Input::get('name'),Input::get('mobile'),Input::get('address'),Input::get('sex'),$area_id->id,$area->id,implode(',',$remark),$area->father_id,Input::get('machine'));
        }

        if($area->id != $customer->area){
            $shift_mount = Mount::find($mount_id);
            $shift_mount->shift = 1;
            $shift_mount->shift_area = $customer->area;
            $shift_mount->save();
        }
        //新增试用工单
        if($noarea == 1) {
            $service_id = Service::insert_try($customer_id, $mount_id, 1, 1, '', implode(',', $remark),$customer->city);
        }else{
            $service_id = Service::insert_try($customer_id, $mount_id, 1, 1, $area->id, implode(',', $remark),'');
        }

        //新增积分及关联操作
        Customer::add_points($customer_id,'attempt',1,0);//增加积分
        //新增邀请装机记录
        if($customer->invite_id > 0){
            Mountrecord::new_record($mount_id,1,$customer_id,$customer->invite_id);
            Customer::add_points($customer->invite_id,'inviter_attempt',1,0,$customer_id);//增加积分
        }

        if($noarea != 1){
            $service = Service::find($service_id);
            //查询该分销商是否有微信派单人
            $count = Work::where('section_id',$area->id)->where('paidan',1)->count();
            if($count != 0){//有则发送模板消息
                $work = Work::where('section_id',$area->id)->where('paidan',1)->first();
                $mount = Mount::find($mount_id);
                $this->forworker($work->openid,$service,$mount);
            }
        }
        return View::make('mounts.success');
	}

	/**
	 * Display the specified resource.
	 * GET /mounts/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		//
	}

	/**
	 * Show the form for editing the specified resource.
	 * GET /mounts/{id}/edit
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
		//

//        $user = Sentry::findUserByLogin('18805813633');
//        $resetCode = $user->getResetPasswordCode();
//        if ($user->checkResetPasswordCode($resetCode))
//        {
//            // Attempt to reset the user password
//            if ($user->attemptResetPassword($resetCode, 'password'))
//            {
//                echo 'success';
//            }
//        }
//        exit;

        $pub = Pub::find(1);

        $PATH = $pub->path;

        $type = Input::get('type');
        $mount = Mount::find($id);
        if($mount->state == 2 && $type == 10){
            $notice = '您已提交签约申请，工作人员将尽快与您联系。';
            return View::make('errors.error2',compact('notice'));
            exit;
        }
        elseif($mount->state != 1 && $type == 10){
            $notice = '您的机器正在使用中，无需再次签约。';
            return View::make('errors.error2',compact('notice'));
            exit;
        }elseif($mount->state < 3 && $type != 'tousu' && $type > 11){
            $notice = '您的机器还未签约，请返回点击我要签约。';
            return View::make('errors.error2',compact('notice'));
            exit;
        }elseif($mount->state > 2 && $type == 11){
            $notice = '您的机器正在使用中，如有问题，请返回点击我要售后。';
            return View::make('errors.error2',compact('notice'));
            exit;
        }elseif($mount->state == 2 && $type == 11){
            $notice = '您的机器正在签约中，如有问题，请返回点击我要售后。';
            return View::make('errors.error2',compact('notice'));
            exit;
        }
//        echo $mount->state.$type;
//        exit;

        $customer_id = Session::get('customer_id');
        $filterins = Filterin::whereHas('mount', function($q)
        {
            $customer_id = Session::get('customer_id');
            $q->where('customer_id', $customer_id)->where('state','>',1);

        })->get();
        $name = array('filterone','filtertwo','filterthree','filterfour','filterfive','filtersix','filterseven','filtereight','filternine','filterten');
        for($i = 0;$i < $mount->machine->count ;$i++){
            $filters[] = $name[$i];
        }

        $filtercos = Filterco::where('customer_id',$customer_id)->get();

        $workers = Work::where('section_id',$mount->section_id)->orderBy('created_at', 'DESC')->paginate(20);
//        echo Service::newcreate($type,$id);
        if($type == 10){
            return View::make('mounts.edit10',compact('mount','filterins','filtercos','type','filters','PATH','workers'));
        }elseif($type == 'tousu'){
            return View::make('mounts.tousu',compact('mount','filterins','filtercos','type','filters','PATH'));
        }else{
            return View::make('mounts.edit',compact('mount','filterins','filtercos','type','filters','PATH','workers'));
        }
	}

	/**
	 * Update the specified resource in storage.
	 * PUT /mounts/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		//

        $type = Input::get('type');

        $worker_id = Input::get('worker_id');
        $mount = Mount::find($id);
        $customer_id = Session::get('customer_id');

        $customer = Customer::find($customer_id);

        if($type == 'tousu'){

            $rate = new Rate();
            $rate->remark = Input::get('textfield');
            $rate->area = $mount->section_id;
            $rate->xiaoqu = $mount->area_id;
            $rate->city = $customer->city;
            $rate->machine_id = $mount->machine_id;
            $rate->customer_id = $customer_id;
            $rate->mount_id = $id;
            $rate->type = 1;
            $rate->save();
            $notice = '投诉或建议提交成功，感谢您的支持！';
            return View::make('errors.success',compact('notice'));
            exit;
        }

        if(Input::get('payType') == 2){
            return Redirect::route('pay.order.index',array('id'=>$id,'showwxpaytitle'=>1));
        }


        DB::beginTransaction();//开启事务

        if($customer_id != $mount->customer_id){
            echo "出错了，请返回菜单重试";
            exit;
        }
        $service = new Service();
        if($type == 12 || $type == 13){//工单类型换芯或维修
            $customer = Customer::find($customer_id);
            if($customer->service_time == 0){
                $service->if_notime = 1;
            }
        }
        if($type == 13){
            $service->filters = Input::get('filters');
            $service->remark = Input::get('select').' '.Input::get('radio').' '.Input::get('fselect');
        }else{
            $service->remark = Input::get('select').' '.Input::get('radio').' '.Input::get('textfield');
        }
        if($type == 10){
            $service->paytype = 1;
        }
        $service->section_id =  $mount->section_id;
        $service->type =  $type;
        $service->mount_id =  $id;
        $service->customer_id =  $customer_id;
        $service->state =  1;
        $service->save();

        if(!$worker_id){
            $count = Work::where('section_id',$mount->section_id)->where('paidan',1)->count();
            if($count != 0){
                $work = Work::where('section_id',$mount->section_id)->where('paidan',1)->first();
                $mount = Mount::find($id);
                $this->forworker($work->openid,$service,$mount);
            }
        }else{

            Service::paidan($service->id,$worker_id);
            $work = Work::find($worker_id);

            $this->forcustomers($service,$work);
            $this->forworkers($service,$work);
        }
        $state_arr = array(
            '10' => '2',
            '11' => '4',
            '12' => '8',
            '13' => '7',
        );
        $mount->state = $state_arr[$type];
        $mount->save();

        DB::commit();//提交事务

        return Redirect::route('services.index');
	}

	/**
	 * Remove the specified resource from storage.
	 * DELETE /mounts/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
		//
	}

    public function fujin(){

        $customer_id = Session::get('customer_id');
        $customer = Customer::find($customer_id);
        return View::make('mounts.fujin',compact('customer'));
    }

    public function pictures(){
        $pub = Pub::find(1);
        $PATH = $pub->path;
        require_once app_path().'/lib/wjs/jssdk.php';
        $jssdk = new JSSDK($pub->AppID,$pub->AppSecret);
        $signPackage = $jssdk->GetSignPackage();
        $customer_id = Session::get('customer_id');
        $mounts = Mount::where('customer_id',$customer_id)->where('state','>',0)->get();
        return View::make('mounts.pictures',compact('mounts','signPackage','PATH'));
    }

    public function picture(){
        $id = Input::get('id');
        $mount = Mount::find($id);
        return View::make('mounts.picture',compact('mount'));
    }

    public function first(){
        $machines = Machine::orderBy('created_at', 'DESC')->get();;


        $value = Session::get('customer_id');
        $customer = Customer::find($value);
//        $areas = $customer->getArea()->get();
        $prices = Machinepr::where('area_id',$customer->city)->get();
        foreach($prices as $price){
            if($price->machine_id == 10){
                $thisprice = $price->price;
            }
        }
        //20150918 泉州地区安装收取40服务费
        if($customer->city == '839'){
            $fuwufei = 40;
        }else{
            $fuwufei = 0;
        }
        return View::make('mounts.first',compact('customer','machines','prices','thisprice','fuwufei'));
    }

    public function shouhou(){
        $customer_id = Session::get('customer_id');
        $customer = Customer::find($customer_id);
        $worker = Work::where('paidan',1)->where('section_id',$customer->area)->first();

        $section = User::where('area',$customer->area)->where('permissions','{"section":1}')->first();
        $big = User::find(14);
        return View::make('mounts.shouhou',compact('worker','section','big'));
    }
    public function prepare(){
        $code = Input::get('code');

        if(isset($code)){
            $code_count = Mount::where('code',$code)->count();
            if($code_count > 0){
                $notice = '该机器二维码已被使用！';
                return View::make('errors.error',compact('notice'));
            }
        }

        $machines = Machine::all();

        $biaozhuns = $this->biaozhun();
        return View::make('mounts.prepare',compact('machines','code','biaozhuns'));
    }

    public function prepare_store(){
        $code = Input::get('code');
        $work_id = Session::get('customer_id');
        $mount_count = Mount::where('code',$code)->count();
        if($mount_count > 0){
            $notice = '该二维码已被使用';
            return View::make('errors.error',compact('notice'));
        }else{
            $work_id = Session::get('customer_id');
            $work = Work::find($work_id);
            $area_id = Area::find(Input::get('area_id'));//获取小区

            $get_area = Input::get('area_id');

            if(!$get_area || $get_area == ''){//如果未选择自动提示，前端填写input提交
                $count_area = Area::where('name',Input::get('area_name'))->where('city_id',$work->city)->count();//查询是否存在该小区
                if($count_area != 0){//已存在则获取小区id
                    $area_id = Area::where('name',Input::get('area_name'))->where('city_id',$work->city)->first();
                    //获取分销商
                    $area = Area::find($area_id->father_id);
                }else{
                    //查询是否有默认分销商
//                $count = User::where('permissions', '{"section":1}')->where('default',1)->count();
//                if($count != 0){//有则将用户分该改分销商
//                    $user = User::where('permissions', '{"section":1}')->where('default',1)->first();
//
                    //create不存在小区，且无father_id，city_id

                    $area_id = new Area();
                    $area_id->name = Input::get('area_name');
                    $area_id->father_id = $work->section_id;
                    $area_id->level = 4;
                    $area_id->save();
                    $noarea =1;
//                    //获取分销商
                    $area = Area::find($work->section_id);
//                }else{
//                    echo '该小区不在服务范围';
//                    exit;
//                }

                }
            }else{
                $area = Area::find($area_id->father_id);
            }

            $work->count = $work->count+1;
            $work->save();


            $mount_id = Mount::insert_try('',Input::get('name'),Input::get('mobile'),Input::get('address'),Input::get('sex'),$area_id->id,$area->id,'',$work->city,Input::get('machine'),$code,1);



            $biaozhuns = $this->biaozhun();

            foreach(Input::get('biaozhun') as $biaozhun){
                $arr = explode('_',$biaozhun);
                $biaozhuns[$arr[0]]['lists'][$arr[1]]['sel'][$arr[2]] = 1;
            }
            if(Input::get('0_0_0')){
                $biaozhuns[0]['lists'][0]['sel'][0] = Input::get('0_0_0');
            }
            if(Input::get('2_0_0')){
                $biaozhuns[2]['lists'][0]['sel'][0] = Input::get('2_0_0');
            }
            if(Input::get('5_0_0')){
                $biaozhuns[5]['lists'][0]['sel'][0] = Input::get('5_0_0');
            }
            if(Input::get('5_1_0')){
                $biaozhuns[5]['lists'][1]['sel'][0] = Input::get('5_1_0');
            }

            $biao = serialize($biaozhuns);



            $service_id = Service::insert_try('', $mount_id, 1, 3, $area->id, '',$area->father_id,$work_id,$biao);


            $machine = Machine::find(Input::get('machine'));


            $time = time();
            for($i = 1; $i<= $machine->count;$i++){
                $cname = 'filter'.$i;
                $data[] = array('mount_id'=>$mount_id,'commodity_id'=>$machine->$cname,'start_time'=>$time,'state'=>1);
            }

            DB::table('filterins')->insert($data);


            $notice = '您的操作提交成功，点击按钮返回微信对话界面。';
            return View::make('errors.success',compact('notice'));
        }


    }


    public function ajax(){
        $content = Input::get('content');
        $value = Session::get('customer_id');
        $customer = Customer::find($value);
        $count = Area::where('city_id',$customer->city)->where('name','<>','')->where('level',4)->where('name', 'like', '%'.$content.'%')->count();
        if($count != 0){
            $areas = Area::where('city_id',$customer->city)->where('name','<>','')->where('level',4)->where('name', 'like', '%'.$content.'%')->get();
            return View::make('mounts.ajax',compact('areas','machines'));
        }else{
            echo 'no';
        }
    }

    public function ajax_forwork(){
        $content = Input::get('content');
        $value = Session::get('customer_id');
        $work = Work::find($value);
        $count = Area::where('city_id',$work->city)->where('name','<>','')->where('level',4)->where('name', 'like', '%'.$content.'%')->count();
        if($count != 0){
            $areas = Area::where('city_id',$work->city)->where('name','<>','')->where('level',4)->where('name', 'like', '%'.$content.'%')->get();
            return View::make('mounts.ajax',compact('areas','machines'));
        }else{
            echo 'no';
        }
    }




    public function forworker($openid,$service,$mount){

        $data[0] = '您有一条新工单等待派单';

        $type[1] = '试用';
        $type[10] = '订购';
        $type[11] = '拆机';
        $type[12] = '维修';
        $type[13] = '换芯';


        $data[1] = $mount->mount_name;
        $data[2] = $mount->mount_mobile;
        $data[3]=  $type[$service->type];
        $data[4]=  $service->remark;
        $data[5]=  '无';
        $data[6]=  '点击安排派单';
        $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc64f995bebe39161&redirect_uri=http%3a%2f%2fcrm.leaderphos.com%2fdiscern&response_type=code&scope=snsapi_userinfo&state=paidan_'.$service->id.'#wechat_redirect';

        \Template::newone($openid,$data,$url,3);
    }

    public function forcustomers($service,$work){

        $data[0] = '尊敬的客户您有一条工单已派单';

        $type[1] = '试用';
        $type[10] = '订购';
        $type[11] = '拆机';
        $type[12] = '维修';
        $type[13] = '换芯';


        $data[1] = $type[$service->type];
        $data[2] = $service->mount->machine->name;
        $data[3]= $work->name;
        $data[4]= '网点';
        $data[5]= $work->mobile;
        $data[6]= '点击查看详细信息';
        $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc64f995bebe39161&redirect_uri=http%3a%2f%2fcrm.leaderphos.com%2fdiscern&response_type=code&scope=snsapi_userinfo&state=service#wechat_redirect';
        Template::newone($service->customer->openid,$data,$url,1);
    }



    public function forworkers($service,$work){

        $data[0] = '尊敬的'.$work->name.'您有一条新的工单需要处理';

        $type[1] = '试用';
        $type[10] = '订购';
        $type[11] = '拆机';
        $type[12] = '维修';
        $type[13] = '换芯';


        $data[1] = $type[$service->type];
        $data[2] = $service->mount->machine->name;
        $data[3]= $work->name;
        $data[4]= '网点';
        $data[5]= $work->mobile;
        $data[6]= '点击查看工单详细信息';
        $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc64f995bebe39161&redirect_uri=http%3a%2f%2fcrm.leaderphos.com%2fdiscern&response_type=code&scope=snsapi_userinfo&state=service_'.$service->id.'#wechat_redirect';
        Template::newone($work->openid,$data,$url,1);
    }

    public function biaozhun(){

        $biaozhuns = array(
            array(
                'name' => '水质监测',
                'lists' => array(
                    array(
                        'name'=>'TDS值测试',
                        'sel'=>array('txt')
                    )
                )
            ),
            array(
                'name' => '清洗/更换滤芯',
                'lists' => array(
                    array(
                        'name'=>'PP棉及滤筒',
                        'sel'=>array('清洗完成','更换完成')
                    ),
                    array(
                        'name'=>'UDF及滤筒',
                        'sel'=>array('清洗完成','更换完成')
                    ),
                    array(
                        'name'=>'CTO及滤筒',
                        'sel'=>array('清洗完成','更换完成')
                    ),
                    array(
                        'name'=>'UF及滤筒',
                        'sel'=>array('清洗完成','更换完成')
                    ),
                    array(
                        'name'=>'RO膜及滤筒',
                        'sel'=>array('清洗完成','更换完成')
                    ),
                    array(
                        'name'=>'T33',
                        'sel'=>array('更换完成')
                    ),
                    array(
                        'name'=>'多功能滤芯',
                        'sel'=>array('更换完成')
                    )
                )
            ),
            array(
                'name' => '机器维修',
                'lists' => array(
                    array(
                        'name'=>'部件更换明细',
                        'sel'=>array('txt')
                    )
                )
            ),
            array(
                'name' => '注意事项提醒',
                'lists' => array(
                    array(
                        'name'=>'机器正常状态提醒',
                        'sel'=>array('告知完成')
                    ),
                    array(
                        'name'=>'机器异常状态提醒',
                        'sel'=>array('告知完成')
                    ),
                    array(
                        'name'=>'清洁卫生',
                        'sel'=>array('清洁完成')
                    )
                )
            ),
            array(
                'name' => '机器保养',
                'lists' => array(

                    array(
                        'name'=>'管路检查',
                        'sel'=>array('告知完成')
                    ),
                    array(
                        'name'=>'电路检查',
                        'sel'=>array('告知完成')
                    ),
                    array(
                        'name'=>'隐患检查',
                        'sel'=>array('告知完成')
                    ),
                )
            ),
            array(
                'name' => '上门服务',
                'lists' => array(
                    array(
                        'name'=>'上门费用',
                        'sel'=>array('txt')
                    ),
                    array(
                        'name'=>'服务费用',
                        'sel'=>array('txt')
                    )
                )
            ),
        );
        return $biaozhuns;
    }
    public function biaozhun_detail(){

        $biaozhuns = array(
            array(
                'name' => '水质监测',
                'lists' => array(
                    array(
                        'name'=>'TDS值测试',
                        'sel'=>array('txt'),
                        'detail'=>'1、常规测试时打开纯水龙头5秒后接水，用TDS笔测试。<br />2、新装产品在压力桶前管子口处接水，用TDS笔测试。<br />3、TDS值≤30为正常值。'
                    )
                )
            ),
            array(
                'name' => '清洗/更换滤芯',
                'lists' => array(
                    array(
                        'name'=>'PP棉及滤筒',
                        'sel'=>array('清洗完成','更换完成'),
                        'detail'=>'1、冲洗PP滤芯表面泥沙铁锈，直至冲洗出来的水清澈。<br /> 2 、PP滤芯内侧中圈变黄变黑时则需要更换。<br /> 3 、滤筒使用干净抹布擦拭冲洗，直至内外侧看不到污垢。<br />'
                    ),
                    array(
                        'name'=>'UDF及滤筒',
                        'sel'=>array('清洗完成','更换完成'),
                        'detail'=>'1、冲洗UDF滤芯表面杂质，直至冲洗出来的水清澈。   <br />    2 、发现UDF滤芯有异味则需要更换，正常一年更换。   <br />                  3 、滤筒使用干净抹布擦拭冲洗，直至内外侧看不到污垢。'
                    ),
                    array(
                        'name'=>'CTO及滤筒',
                        'sel'=>array('清洗完成','更换完成'),
                        'detail'=>'1、冲洗CTO滤芯表面杂质，直至冲洗出来的水清澈。   <br />    2 、发现CTO滤芯有异味则需要更换，正常一年更换。     <br />                3 、滤筒使用干净抹布擦拭冲洗，直至内外侧看不到污垢。'
                    ),
                    array(
                        'name'=>'UF及滤筒',
                        'sel'=>array('清洗完成','更换完成'),
                        'detail'=>'1、冲洗UF滤芯表面杂质，直至冲洗出来的水清澈。   <br />       2 、发现UF滤芯堵塞不出水则需要更换，正常两年更换。      <br />               3 、滤筒使用干净抹布擦拭冲洗，直至内外侧看不到污垢。'
                    ),
                    array(
                        'name'=>'RO膜及滤筒',
                        'sel'=>array('清洗完成','更换完成'),
                        'detail'=>'1、冲洗RO膜滤芯表面杂质，直至冲洗出来的水清澈。  <br />     2 、发现RO膜滤芯堵塞不出水或TDS值不达标则需要更换。正常两年更换。<br />3 、滤筒使用干净抹布擦拭冲洗，直至内外侧看不到污垢。'
                    ),
                    array(
                        'name'=>'T33',
                        'sel'=>array('更换完成'),
                        'detail'=>'1、正常一年整体更换。<br /> 2、发现纯水有异味，口感不佳，则需要更换。'
                    ),
                    array(
                        'name'=>'多功能滤芯',
                        'sel'=>array('更换完成'),
                        'detail'=>'1、正常一年整体更换。<br /> 2、发现PH值达不到弱碱性则需要更换。'
                    )
                )
            ),
            array(
                'name' => '机器维修',
                'lists' => array(
                    array(
                        'name'=>'部件更换明细',
                        'sel'=>array('txt'),
                        'detail'=>'需将旧部件给客户展示。'
                    )
                )
            ),
            array(
                'name' => '注意事项提醒',
                'lists' => array(
                    array(
                        'name'=>'机器正常状态提醒',
                        'sel'=>array('告知完成'),
                        'detail'=>'1、机器在自来水停水的情况下会自动报警，需要把电源关闭，通水了重新通电，机器自动正常工作。    <br />           2、更换T33滤芯之后，需要对T33滤芯进行冲洗，2-3桶水，刚开始会有黑水，属于正常现象。              <br />         3、长时间不在家，需要把机器的水源电源切断。      <br />     4、机器正常工作时会有泵工作的声音，制水结束机器停止工作，就没有声音。      <br />      5、机器在工作状态下会排放废水，停止工作后不产生废水。'
                    ),
                    array(
                        'name'=>'机器异常状态提醒',
                        'sel'=>array('告知完成'),
                        'detail'=>'1、机器工作不正常，报检修，需要切断电源水源，联系服务人员上门维护。<br /> 2、机器发现渗水漏水，需要切断电源水源，联系服务人员上门维护。'
                    ),
                    array(
                        'name'=>'清洁卫生',
                        'sel'=>array('清洁完成'),
                        'detail'=>'恢复客户家原先布置，清洁橱柜、地面、擦干水渍。'
                    )
                )
            ),
            array(
                'name' => '机器保养',
                'lists' => array(

                    array(
                        'name'=>'管路检查',
                        'sel'=>array('告知完成'),
                        'detail'=>'1、管路是否松动。<br />2、橡皮垫片是否点好。<br /> 3、废水管固定是否安全。<br />4、水龙头是否松动。<br />5、发现问题重新处理好。'
                    ),
                    array(
                        'name'=>'电路检查',
                        'sel'=>array('告知完成'),
                        'detail'=>'1、检查插排是否安全，是否会被台面漏水滴到。     <br />      2、检查机器是否会北台面漏水滴到。'
                    ),
                    array(
                        'name'=>'隐患检查',
                        'sel'=>array('告知完成'),
                        'detail'=>'1、机器接电是否老化。<br />2、机器废水排放是否通畅。<br />  3、客户家水管是否有老化，渗水现象，建议更换。      <br />             4、客户家下水管是否有隐患，容易溢水，或产生异味。'
                    ),
                )
            ),
            array(
                'name' => '上门服务',
                'lists' => array(
                    array(
                        'name'=>'上门费用',
                        'sel'=>array('txt'),
                        'detail'=>'各个城市的距离及人工成本会有差异。'
                    ),
                    array(
                        'name'=>'服务费用',
                        'sel'=>array('txt'),
                        'detail'=>'各个城市的距离及人工成本会有差异。'
                    )
                )
            )
        );
        return $biaozhuns;
    }

}